package com.company.nowcoder;

import java.util.Scanner;

/**
 * 盛夏时节，小牛需要吃雪糕来防暑姜维来度过盛夏。
 * 先售卖一盒一份、一盒两份、一盒三份三种雪糕。小牛每天可以吃若干盒的雪糕，但总共只能吃6份雪糕，吃多了闹肚子，吃少了不能降温。
 * 而且当小牛打开一盒雪糕时，要把整盒里的所有雪糕都吃完，
 * 那么现给出X天盛夏天，A盒一盒一份雪糕，B盒一盒两份雪糕，C盒一盒两份雪糕，那么请问小牛是否能够度过夏天？
 */

public class Main2 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int T = sc.nextInt();
        boolean[] res = new boolean[T];
        for(int i = 0;i < T;i++){
            int N = sc.nextInt();
            int A = sc.nextInt();
            int B = sc.nextInt();
            int C = sc.nextInt();
            res[i] = isDuriodTheseHotDays(N,A,B,C);
        }
        for (int i = 0;i < res.length;i++){
            if(res[i] == true){
                System.out.println("Yes");
            }else{
                System.out.println("No");
            }
        }
    }

    private static boolean isDuriodTheseHotDays(int days,int a, int b, int c) {
        int totalIcecreams = days * 6;
        // 分几种情形
        // case1 三种雪糕都在
        while(a > 0 && b > 0 && c > 0){
            totalIcecreams -= 6;
            a--;
            b--;
            c--;
            if(totalIcecreams == 0){
                return true;
            }
        }
        if(totalIcecreams < 0){
            return false;
        }
        // case2 各存在两种
        if(a > 0 && b > 0){
            while (a > 0 && b > 0){
                totalIcecreams -= 6;
                a -= 2;
                b -= 2;
                if(totalIcecreams == 0){
                    return true;
                }
            }
            if(a > 0){
                totalIcecreams -= a;
            }
            if(b > 0){
                totalIcecreams -= 2 * b;
            }
            if(totalIcecreams < 0){
                return false;
            }
        }else if(a > 0 && c > 0){
            while (a > 3 && c > 1) {
                totalIcecreams -= 6;
                a -= 3;
                c -= 1;
                if (totalIcecreams == 0) {
                    return true;
                }
            }
            if(a > 0){
                totalIcecreams -= a;
            }
            if(c > 0){
                totalIcecreams -= 3 * c;
            }
            if(totalIcecreams < 0){
                return false;
            }
        }else if(b > 0 && c > 0){
            while (c > 1){
                totalIcecreams -= 6;
                c -= 2;
                if (totalIcecreams == 0) {
                    return true;
                }
            }
            if(c == 1){
                totalIcecreams -= 3;
            }
            if(totalIcecreams < 0){
                return false;
            }
        }

        // case3 只有一个有
        if(a != 0){
            return totalIcecreams == a;
        }
        if(b != 0){
            return totalIcecreams == b * 2;
        }
        if(c != 0){
            return  totalIcecreams == c * 3;
        }
        return false;
    }
}
